#!/bin/sh

set -e
#set -x

if [ "$1" = "purge" ] && [ -f /usr/share/debconf/confmodule ]; then
    . /usr/share/debconf/confmodule
    db_purge
fi

#########################
# Restart Tomcat
#########################

invoke-rc.d --quiet tomcat[[debian.tomcat.version]] restart || {
    RESULT=$?
    # Ignore if tomcat[[debian.tomcat.version]] init script does not exist (yet)
    if [ $RESULT != 100 ]; then
    exit $RESULT
    fi
}
